Intersoft ClientUI Documentation
Subscribe(Action<TPayload>,SubscribeOptions,Predicate<TPayload>) Method



The delegate that gets executed when the event is published.
Specifies the options to apply to the subscription.
Filter to evaluate if the subscriber should receive the event.
Subscribes a delegate to an event.
Syntax
Public Overloads Overridable Function Subscribe( _
   ByVal action As Action(Of TPayload), _
   ByVal options As SubscribeOptions, _
   ByVal filter As Predicate(Of TPayload) _
) As SubscriptionToken
Dim instance As DelegateEvent(Of TPayload)
Dim action As Action(Of TPayload)
Dim options As SubscribeOptions
Dim filter As Predicate(Of TPayload)
Dim value As SubscriptionToken
 
value = instance.Subscribe(action, options, filter)

Parameters

action
The delegate that gets executed when the event is published.
options
Specifies the options to apply to the subscription.
filter
Filter to evaluate if the subscriber should receive the event.

Return Value

A SubscriptionToken that uniquely identifies the added subscription.
Remarks
If options contains UseStrongReference flag, the action and filter references will be keep alive. In such case, you must explicitly call Unsubscribe for the event when disposing the subscriber in order to avoid memory leaks or unexpected behaviors.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DelegateEvent<TPayload> Class
DelegateEvent<TPayload> Members
Overload List

Send Feedback